<?php

namespace app\supplier\model\sms;

use app\common\model\sms\Sms as BaseSms;

class Sms extends BaseSms
{

    public function getSmsData($startDate, $endDate, $shop_supplier_id)
    {
        $model = $this;
        if ($shop_supplier_id > 0) {
            $model = $model->where('shop_supplier_id', '=', $shop_supplier_id);
        }
        $model = $model->where('create_time', '>=', strtotime($startDate));
        if (is_null($endDate)) {
            $model = $model->where('create_time', '<', strtotime($startDate) + 86400);
        } else {
            $model = $model->where('create_time', '<', strtotime($endDate) + 86400);
        }
        return $model->count();
    }
}